﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using ST.Buz.Base.Entity;

namespace ST.Buz.Base.Mapping
{
	public partial class Map_BJG_Machining : IEntityTypeConfiguration<BJG_Machining>
	{
		public void Configure(EntityTypeBuilder<BJG_Machining> builder)
		{
			builder.HasKey(e => new { e.ID })
				.HasName("PK_BJG_Machining")
				.IsClustered(false);

			builder.HasIndex(e => new { e.PartnerID })
				.HasName("IX_BJG_Machining_PartnerID")
				.IsClustered(false);

			builder.Property(e => e.SNo)
				.IsUnicode(false);

			builder.Property(e => e.Rolls)
				.HasColumnType("decimal(18,2)")
				.HasDefaultValueSql("((0))")
				.ValueGeneratedNever();

			builder.Property(e => e.Meters)
				.HasColumnType("decimal(18,2)")
				.HasDefaultValueSql("((0))")
				.ValueGeneratedNever();

			builder.Property(e => e.Price)
				.HasColumnType("decimal(18,2)")
				.HasDefaultValueSql("((0))")
				.ValueGeneratedNever();

			builder.Property(e => e.Total)
				.HasColumnType("decimal(18,2)")
				.HasDefaultValueSql("((0))")
				.ValueGeneratedNever();

			builder.Property(e => e.PreRecvTotal)
				.HasColumnType("decimal(18,2)")
				.HasDefaultValueSql("((0))")
				.ValueGeneratedNever();

			builder.Property(e => e.AddDate)
				.HasDefaultValueSql("(getdate())")
				.ValueGeneratedNever();
		}
	}
}
